1. Field of the Invention
The present invention relates to an image coding apparatus and an image coding method for compressively coding image data.
2. Description of the Related Art
Image data generally falls into two broad categories: artificial image data generated by computer such as image data described in PDL (page description language), and scan-in image data read by scanner such as bit map image data. These two kinds of image data are most often coded compressively in order to reduce their quantities.
Illustratively, JPEG-LS (Part-1 ISO/IEC FDIS 14495-1) is known as a coding technique applicable to both artificial image data and scan-in image data. JPEG-LS has been standardized as a method for improving by about 10 percent the coding efficiency achieved by JPEG (Joint Photographic Expert Group) and JBIG (Joint Bi-level Image Experts Group) schemes. A major characteristic of the JPEG-LS method is that it applies lossless (reversible) coding to artificial image data and near-lossless (near-reversible) coding to scan-in image data.
FIG. 13 is a schematic block diagram of a typical image coding apparatus adopting JPEG-LS for image data coding. This image coding apparatus works as follows: input image data 401 and decoded pixel data 402 are first fed to a window composing element 41. In turn, the window composing element 41 sends a group of peripheral pixel values 403 to a pixel value gradient determining element 42. Given the peripheral pixel values, the pixel value gradient determining element 42 computes a pixel value gradient of the peripheral pixels surrounding a target pixel to be coded. If the computed gradient is found less than a tolerance 404 coming from a tolerance designating element 43, the target pixel to be coded is judged flat and control is passed on to a run length extracting element 44. If the gradient is found greater than the tolerance 404, then regular mode is entered. That is, a pixel value predicting element 45 predicts a value of the target pixel to be coded on the basis of the peripheral pixel value group 403. A prediction error computing element 46 computes a prediction error regarding the target pixel. A prediction error quantizing element 47 quantizes the computed prediction error. Taking the quantized prediction error as a coding symbol 406, an information source coding element 48 codes the prediction error. The coded output of the element 48 combines with a code from the run length extracting element 44 to become output coded data 407. A local decoding element 49 performs local decoding and supplies the result as decoded pixel data 402 to the window composing element 41.
The JPEG-LS method outlined above is based on pixel value prediction and has no recourse to resolution adaptation known as sub-sampling. Sub-sampling involves discarding the whole information furnished by any one pixel. In low frequency image regions, particularly in graduated portions of scan-in image data, sub-sampling should preferably be utilized to enhance the efficiency of coding. In the setup of FIG. 13, however, the pixel value gradient determining element 42 determines whether or not to proceed with sub-sampling based on the gradient of pixels around the target pixel to be coded. In other words, the sub-sampling of the setup has no direct relation to prediction error.
Meanwhile, some of the image data coding techniques proposed so far have introduced the concept of sub-sampling into predicted coding. Illustratively, Japanese Published Unexamined Patent Application No. Hei 10-294872 discloses a sub-sampling-based coding technique for selecting an index (identification information) of one of multiple predictors that has the smallest prediction error so that a run length of the rank of the selected index is coded.
More particularly, as shown in FIG. 14, a group of peripheral pixel values 503 representing pixels around a target pixel to be coded is acquired through a window composing element 51. Given the peripheral pixel value group 503, a pixel value approximating element 52 having multiple predictors computes a group of decoded pixel value candidates 504. An error selecting element 54 checks for a difference between each of the pixel values approximated by the pixel value approximating element 52 on the one hand, and the value of a target pixel in an image of interest on the other hand. If the difference (i.e., prediction error) is found less than a tolerance 505 coming from a tolerance designating element 53, then the error selecting element 54 sends an index of the predictor having the smallest prediction error to a decoded pixel selecting element 55 and a rank/run length extracting element 56. If the prediction error is judged to be greater than the tolerance 505, the error selecting element 54 supplies the rank/run length extracting element 56 with an index of an error minimizing approximation 506 for minimizing the prediction error as well as with the value of the prediction error in effect at that point. Based on the error minimizing approximation index 506 or the prediction error value received from the error selecting element 54, the rank/run length extracting element 56 extracts a run length of the index rank and sends it as a coding symbol 507 to an information source coding element 57. The information source coding element 57 performs information source coding to compress the statistical redundancy included in the coding system 507 to provide output coded data 508. The decoded pixel selecting element 55, given the error minimizing approximation index 506, selects a decoded pixel value from the group of decoded pixel value candidates 504 and feeds it as decoded pixel data 502 to the window composing element 51 for decoding of the next pixel.
In the manner described above, the coding technique of Japanese Published Unexamined Patent Application No. Hei 10-294872 adopting the concept of sub-sampling subjects artificial image data and scan-in image data to the same framework of reversible and near-reversible coding, and executes an image coding process by coding indexes of prediction techniques (predictors) for approximating each target pixel to be coded. That is, the approximation techniques (predictors) based on important factors of images are adopted for data compression without deterioration of image quality.
However, the conventional image data coding method disclosed by the above-cited patent application has its share of deficiencies. The method, in selecting one of the prediction techniques (predictors) for approximating the target pixel to be coded, abides by a single rule dictating that the selected technique be one that has the smallest prediction error. Hence the possible major flaw of the method as outlined below.
With pixel values making up artificial image data, efforts to reduce their prediction errors translate into improvements in image quality of non-reversible coding. Pixel values constituting scan-in image data, on the other hand, undergo MTF (modulation transfer function) illustratively in the optics of a scanner and otherwise gather various noises along the way. For that reason, minimizing the prediction error of each pixel does not necessarily result in improvements in image quality of non-reversible coding.
The above-cited conventional image data coding technique, particularly when addressing scan-in image data and when their prediction errors exceed a tolerance, is liable not only to worsen its coding efficiency but also to slow down its processing speed. That is because the prediction errors themselves are coded. Even if the prediction errors are below the tolerance, the selected predictor tends to change frequently as long as the sole judging rule dictates that the prediction error be minimal per pixel. The tendency defeats the supposed effects of coding run lengths of index ranks, rendering the coding process inefficient. Furthermore, improvements in image quality cannot be expected unless predictors are selected not on the basis of pixel-by-pixel local information but based on more extensive information.
The present invention has been made in view of the above circumstances and provides an image coding apparatus and an image coding method which, when subjecting artificial and scan-in image data to the same framework of reversible or near-reversible coding, select a technique for predicting a target pixel to be coded not on the basis of pixel-by-pixel local information alone but based on more extensive information, thereby boosting coding efficiency and enhancing image quality in non-reversible coding without recourse to bulky computation resources or massive calculation processes.
In carrying out the invention and according to one aspect thereof, there is provided an image coding apparatus including an approximating element which has plural different prediction techniques to approximate, in input image data, a value of a target pixel to be coded with reference to values of peripheral pixels surrounding the target pixel, and a holding element which holds information about ranks of the prediction techniques. The ranks are obtained upon processing of the pixel preceding the target pixel. The apparatus also includes a determining element which computes an error between each of approximate values obtained by the plural prediction techniques and the value of the target pixel, and which selects for the target pixel one of the prediction techniques based on the computed error. The determining element performs the selection by preferentially referencing the rank information held in the holding element if the error is within a predetermined tolerance. The apparatus further includes a coding element which codes the value of the target pixel using the approximate value obtained by the prediction technique selected by the determining element.
According to another aspect of the invention, there is provided an image coding apparatus including an approximating element which has plural different prediction techniques to approximate, in input image data, a value of a target pixel to be coded with reference to values of peripheral pixels surrounding the target pixel, and a holding element which holds information about run lengths approximated by the prediction techniques. The run lengths are obtained upon processing of each pixel preceding the target pixel. The apparatus also includes a determining element which computes an error between each of approximate values obtained by the plural prediction techniques and the value of the target pixel, and which selects for the target pixel one of the prediction techniques based on the computed error. The determining element performs the selection by preferentially referencing the run lengths specified by the information held in the holding element if the error is within a predetermined tolerance. The apparatus further includes a coding element which codes the value of the target pixel using the approximate value obtained by the prediction technique selected by the determining element.
According to a further aspect of the invention, there is provided an image coding method including the steps of approximating, in input image data, a value of a target pixel to be coded with reference to values of peripheral pixels surrounding the target pixel by using plural different prediction techniques, and computing an error between each of approximate values obtained by the prediction techniques and the value of the target pixel, to determine whether the computed error is within a predetermined tolerance. The method further includes the steps of, if the error is found to be within the predetermined tolerance and if the prediction techniques have been given ranks beforehand, selecting one of the prediction techniques for the target pixel by preferentially referencing the ranks, if the error is not within the predetermined tolerance and if the prediction techniques are not given ranks, then selecting one of the prediction techniques for addressing the target pixel on the basis of differences in magnitude between the errors regarding the approximate values, and coding the target pixel using the approximate value provided by the selected prediction technique.
According to an even further aspect of the invention, there is provided an image coding method including the steps of approximating, in input image data, a value of a target pixel to be coded with reference to values of peripheral pixels surrounding the target pixel by using plural different prediction techniques, and computing an error between each of approximate values obtained by the plural prediction techniques and the value of the target pixel, to determine whether the computed error is within a predetermined tolerance. The method further includes the steps of, if the error of any one of the approximate values obtained by any one of the prediction techniques is found to be within the predetermined tolerance and if the target pixel is shifted successively from one pixel position to another within the input image data, determining whether the errors of the approximate values obtained by the same prediction technique in different pixel positions fall successively within the predetermined tolerance, if the errors of pixels having run lengths are found to be successively within the predetermined tolerance, then selecting one of the prediction techniques that provides the largest run length as the prediction technique for a group of pixels corresponding to the largest run length, if the computed error is not found to be within the predetermined tolerance and if the errors in different pixel positions are not successively found to be within the tolerance, then selecting one of the prediction techniques for the target pixel on the basis of differences in magnitude between the errors regarding the approximate values, and coding the target pixel using the approximate value provided by the selected prediction technique.
From one point of view, the inventive image coding apparatus and image coding method determine, upon selecting one of multiple prediction techniques to approximate the value of target pixel to be coded, whether the error of each approximated value falls within a predetermined tolerance. If the error of the value approximated by each prediction technique is found to be within the tolerance and if the prediction techniques have been given ranks beforehand, these ranks are preferentially referenced in selecting one of the prediction techniques for addressing the target pixel. That is, not only the prediction error per pixel but also the rank of each prediction technique with respect to the preceding pixel is taken into account in selecting the appropriate prediction technique. It follows that as long as the errors fall within the tolerance, the ranks of the prediction techniques will not change frequently.
From another point of view, the inventive image coding apparatus and image coding method determine, upon selecting one of multiple prediction techniques to approximate the value of target pixel to be coded, whether the errors of the approximate values obtained by the same prediction technique in different pixel positions fall successively within the predetermined tolerance. If the errors are found to be successively within the predetermined tolerance, one of the prediction techniques is selected preferentially in terms of run lengths. That is, since not only the prediction errors per pixel but also their run lengths are used as a selection rule, what is preferentially selected from among the prediction techniques with their errors falling within the tolerance is the technique having the largest run length.
Other features and advantages of the invention will become more apparent upon a reading of the following description and appended drawings.